package com.project.xsf.service.impl;

import com.project.junM.entity.TMember;
import com.project.xsf.entity.TInterposeFood;
import com.project.xsf.mapper.TInterposeFoodMapper;
import com.project.xsf.service.TInterposeFoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpSession;
import java.util.List;

@Service
@Transactional
public class TInterposeFoodImpl implements TInterposeFoodService {
    @Autowired
    private TInterposeFoodMapper tInterposeFoodMapper;

    @Override
    public List<TInterposeFood> queryByMemberId(HttpSession session) {
        TMember member = (TMember) session.getAttribute("user");
        System.out.println(member);
        return tInterposeFoodMapper.queryByMemberId(member.getId());
    }
}
